R for Health Data Science by Ewen Harrison;Riinu Pius; & Pius Riinu

R for Health Data Science by Ewen Harrison;Riinu Pius; & Pius Riinu

Author:Ewen Harrison;Riinu Pius; & Pius Riinu [Неизв.]
Language: eng
Format: epub
Publisher: CRC Press (Unlimited)
Published: 2020-10-20T21:00:00+00:00


7.2.5 Simple linear regression

As you can see, ggplot() is very happy to run and plot linear regression models for us. While this is convenient for a quick look, we usually want to build, run, and explore these models ourselves. We can then investigate the intercepts and the slope coefficients (linear increase per year):

First let’s plot two countries to compare, Turkey and United Kingdom:

gapdata %>%

filter(country %in% c("Turkey", "United Kingdom")) %>%

ggplot(aes(x = year, y = lifeExp, colour = country)) +

geom_point()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.